package com.jsgt.greekfire.ui.trading

import android.os.Bundle
import android.view.Gravity
import android.view.Window
import com.fhx.core.base.BaseDialogFragment
import com.fhx.core.utils.ScreenUtil
import com.fhx.core.utils.ToastUtils
import com.jsgt.greekfire.R

/**
 * 交易信息
 * author fhx
 * create time 2020/4/29 9:45
 **/
class TradingInfoFragment : BaseDialogFragment() {
    override fun getLayoutId(): Int = R.layout.fragment_trading_info

    override fun getDialogStyle(): Int = R.style.dialog

    override fun canCancel(): Boolean = true

    override fun setWindowAttributes(window: Window?) {
        window?.setWindowAnimations(R.style.leftToRightAnim)
        window?.setGravity(Gravity.LEFT)
        val params = window?.attributes
        params?.height = ScreenUtil.getScreenHeight(mContext!!)
        window?.attributes = params
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        findViewById(R.id.close_iv)?.setOnClickListener {
            dismiss()
        }
        findViewById(R.id.coin_bill_tv)?.setOnClickListener {
            ToastUtils.show(context!!, "开发中...")
//            if (LOGIN_STATUS == 1) {
//                startActivity(Intent(activity, BillCoinActivity::class.java))
//            } else {
//                startActivity(Intent(activity, EntranceActivity::class.java))
//            }
            dismiss()
        }
        findViewById(R.id.current_tv)?.setOnClickListener {
            ToastUtils.show(context!!, "开发中...")
//            if (LOGIN_STATUS == 1) {
//                DelegationActivity.start(context!!, DelegationActivity.TYPE_CURRENT)
//            } else {
//                startActivity(Intent(activity, EntranceActivity::class.java))
//            }
            dismiss()
        }
        findViewById(R.id.history_tv)?.setOnClickListener {
            ToastUtils.show(context!!, "开发中...")
//            if (LOGIN_STATUS == 1) {
//                DelegationActivity.start(context!!, DelegationActivity.TYPE_HISTORY)
//            } else {
//                startActivity(Intent(activity, EntranceActivity::class.java))
//            }
            dismiss()
        }
    }
}